/*
 * Created on 25.03.2004
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package ro.qi.framework.sys.i18n.resources.entities;

import ro.qi.framework.sys.entities.Entity;

/**
 * @author vlad lepadatu
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class ResourceCollection extends Entity {

//	public ResourceCollection() {
//		super();
//	}

	public ResourceCollection() {
		super();
		select();
	}

	public ResourceCollection(int localeId) {
		super();
		setLocaleId(localeId);
		select();
	}

	public int getCollectionSize() {
		return getCollectionSize("resources");
	}
	
	public int getId(int index) {
		return getCollectionIntValue("resources", "resourceId", index);
	}

//	public static ResourceCollection selectAll() {
//		ResourceCollection resourceCollection = new ResourceCollection();
//		resourceCollection.select();
//		return resourceCollection;
//	}

//	public static ResourceCollection selectByLastUpdate(Date lastUpdate) {
//		ResourceCollection resourceCollection = new ResourceCollection();
//		resourceCollection.setLastUpdate(lastUpdate);
//		resourceCollection.action("selectUpdated");
//		return resourceCollection;
//	}

//	public void setLastUpdate(Date value) {setValue("lastUpdate", value);}
//	public Date getLastUpdate() {return getDateValue("lastUpdate");}
//	public void setName(String value) {setValue("name", value);}
//	public String getName() {return getStringValue("name");}
//	public void setUnique(boolean value) {setValue("unique", value);}
//	public boolean isUnique() {return getBooleanValue("unique");}
//	public int getNoResources() {return getCollectionSize("resources");}
//	public int getResourceId(int index) {return getCollectionIntValue("resources", "resourceId", index);}
//	public int getTemplateId(int index) {return getCollectionIntValue("resources", "templateId", index);}
//	public String getResourceName(int index) {return getCollectionStringValue("resources", "resourceName", index);}
//	public Date getResourceCreateTime(int index) {return getCollectionDateValue("resources", "resourceCreateTime", index);}
//	public Date getResourceUpdateTime(int index) {return getCollectionDateValue("resources", "resourceUpdateTime", index);}

	public Resource getResource(int index) {
		return new Resource(getId(index), getLocaleId());
	}

	public Resource getResource(int index, int localeId) {
		return new Resource(getId(index), localeId);
	}

}
